/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.web.index.vo;

import com.pingan.haofang.searchcloud.common.auth.AuthDataType;
import com.pingan.haofang.searchcloud.common.auth.ValidDataAuth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * 索引数据源构建
 *
 * @author zhangbi617
 * @date 15/05/2017
 */
@ApiModel
public class IndexDatasourceBuildVO {
    /**
     * id
     */
    @ApiModelProperty("id，请求时无需填写")
    private Long id;

    /**
     * 索引ID
     */
    @ApiModelProperty("索引Id")
    @NotNull
    @ValidDataAuth(dataType = AuthDataType.INDEX_ID)
    private Long indexId;

    /**
     * cron表达式
     */
    @ApiModelProperty("全量定时表达式,最大长度64")
    @NotBlank
    @Length(max = 64)
    private String cron;

    /**
     * cron表达式
     */
    @ApiModelProperty("增量定时表达式,最大长度64")
    @NotBlank
    @Length(max = 64)
    private String incCron;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getIndexId() {
        return indexId;
    }

    public void setIndexId(Long indexId) {
        this.indexId = indexId;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    @Override
    public String toString() {
        return "IndexDatasourceBuildVO{" +
                "id=" + id +
                ", indexId=" + indexId +
                ", cron='" + cron + '\'' +
                ", incCron='" + incCron + '\'' +
                '}';
    }

    public String getIncCron() {
        return incCron;
    }

    public void setIncCron(String incCron) {
        this.incCron = incCron;
    }

}
